import {
  MessageBox,
  Message
} from 'element-ui'

export default {
  messageObj: {
    content: '',
    type: '',
    title: '',
    suFun: function () {
    }
  },
  messagebox: function (o) {
    MessageBox.confirm(o.content, o.title, {
      confirmButtonText: 'Confirm',
      cancelButtonText: 'Cancel',
      type: o.type
    }).then(() => {
      o.suFun()
    }).catch(() => {
      Message({
        type: 'info',
        message: 'Operation cancelled'
      })
    })
  }
}
